/**
 * @Description:
 * @Author: CHEHSHUANG
 * @Date: 2019/3/14
 */
import httpUtils from "../../commons/utils/FeatchUtils";
import {basicUrl, fimAPI} from "../../configs/DefaultConfig";
import {convertSearchFilter} from "../../commons/utils/CommonUtils";

export const findPersonalSettingInfo = (params={}) => {
  return httpUtils.get(basicUrl+"/userProfile/findPersonalSettingInfo",params)
}
export const userInfoSave = (params={}) => {
  return httpUtils.postJson(basicUrl+"/userProfile/save",params)
}
export const listAllUserAccountByUserId = (params={}) => {
  return httpUtils.get(basicUrl+"/userAccount/findByUserId",params)
}
export const accountSave = (params={}) => {
  return httpUtils.postJson(basicUrl+"/userAccount/saveAccount",params)
}
export const accountDelete = (params="") => {
  return httpUtils.delete(basicUrl+"/userAccount/delete",params)
}
export const updatePassword = (params={}) => {
  return httpUtils.postJson(basicUrl+"/userAccount/updatePassword",params)
}
export const listAllAssignedPositions = (params={}) => {
  return httpUtils.get(basicUrl+"/employeePosition/listAllAssignedPositionsByEmployeeId",params)
}

//邮件提醒
export const saveUserEmailAlert = (params={}) => {
  return httpUtils.postJson(basicUrl+"/userEmailAlert/save",params)
}
export const findMyEmailAlert = (params={}) => {
  return httpUtils.get(basicUrl+"/userEmailAlert/findMyEmailAlert",params)
}

//支付信息
export const listPersonnelByCode = (params={}) => {
   return httpUtils.get(basicUrl+"/userProfile/listPersonnelByCode",params)
}
export const listPaymentInfoByCode = (params={}) => {
   return httpUtils.get(basicUrl+"/userProfile/listPaymentInfoByCode",params)
};
export const savePaymentInfo = (params={}) => {
  return httpUtils.postJson(basicUrl+"/userProfile/savePaymentInfo ",params)
}
export async function deletePaymentInfo(param=''){
  //return httpUtils.delete(basicUrl+"/paymentInfo/delete",param);
  // return httpUtils.delete(basicUrl+"/paymentInfo/deletePaymentInfo",param);
  return httpUtils.delete(fimAPI + "/paymentInfo/delete", param)
}

export const listAllBankCategory = (params={}) => {
  return httpUtils.get(basicUrl+"/userProfile/listAllBankCategory",params)
}
//银行
export const listByBankCategory = (params={}) => {
  Object.assign(params,{S_createdDate:'ASC',quickSearchProperties:["code","name"]});
  return httpUtils.postJson(basicUrl+"/userProfile/listByBankCategory",convertSearchFilter(params))
}
//銀行
export const listBankByCategoryId = (params = {}) => {
  return httpUtils.get(fimAPI + "/bank/findByBankCategoryId",params)
}


